// Implementation of lists, using singly linked elements.
// (c) 1998, 2001 duane a. bailey

package Calculadora;
/**
 * An implementation of lists using singly linked elements, similar to that of {@link java.util.LinkedList java.util.LinkedList}.
 * @version $Id: SinglyLinkedList.java,v 4.1 2000/12/29 02:39:16 bailey Exp bailey $
 * @author, 2001 duane a. bailey
 * @see DoublyLinkedList
 * @see CircularList
 * @since 12/08/2012
 * @version 1.0
 * @author Douglas Dávila
 */
public class SinglyLinkedList<E> extends AbstractList<E>
{
  protected int count; // list size
  protected SinglyLinkedListElement head; // ref. to first element
   
  public SinglyLinkedList()
   // post: generates an empty list
   {
      head = null;
      count = 0;
   }
   
    @Override
   public int size()
   // post: returns number of elements in list
  {
    return count;
  }
  
   /**
     * Add a value to head of list.
     *
     * @post value is added to beginning of list
     * 
     * @param value The value to be added to head of list.
     */

    @Override
    public void addFirst(Object value)
    {
	// note order that things happen:
	// head is parameter, then assigned
	head = new SinglyLinkedListElement(value, head);
	count++;
    }

    @Override
    public E getFirst() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public E removeFirst() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
        
}

